<template>
  <div id="app">
    num的数量 {{addShowNum}}
    <button @click='change'>更改数量</button>
  </div>
</template>

<script>
import HelloWorld from './components/HelloWorld'

export default {
  name: 'App',
  components: {
    HelloWorld
  },
  methods: {
    change(){
      this.$store.commit('addNum',{num: 5})
    }
  },
  computed: {
    addShowNum(){
      return this.$store.getters.getNum
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
